global class ContractValidWebService {

    WebService static String setContractValid(Id contractid) {
        system.debug(contractid);
        try{
            Contract__c c = new Contract__c();
            c = [ select Id, Status__c from Contract__c where Id = :contractid ];
    
            c.Status__c = '已生效';
            update c;
            Approval.lock(c, false);
            return 'OK';
        } catch(Exception e) {
            return e.getMessage();
        }
    }
}